<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateImchatMessageLog extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('imchat_message_log', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('imchat_id')->comment('聊天记录id');
            $table->string('send_channel',32)->comment('发送人');
            $table->string('receive_channel',32)->comment('接收人');
            $table->string('message',800)->comment('发送内容');
            $table->unsignedTinyInteger('status')->default(0)->comment('阅读状态，0 未读（默认），1 已读');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('imchat_message_log');
    }
}
